package com.study.model.jdao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.study.model.pojo.Customer;
import com.study.model.pojo.Dictionary;
import com.study.model.pojo.FormsDetail;
import com.study.model.pojo.Linkman;

public interface ILinkmanDAO extends CrudRepository<Linkman, Integer> {

	/**
	 * 查询对应客户的联系人
	 * 
	 * @param ins
	 * @return
	 */
	@Query("select b from Linkman b where b.customer.cusId=?1")
	List<Linkman> findBycustomers(Integer ins);

	public Linkman findByLinNameLike(String input);


	public Linkman findByLinId(int linid);

	/**
	 * 根据名字找到联系人
	 * 
	 * @param name
	 * @return
	 */
	public Linkman findByLinName(String name);
	
	/**
	 * 通过客户id查找到主联系人
	 */
	public Linkman findByCustomerAndDictionary4(Customer customer,Dictionary dictionary);
}
